package gui;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JScrollBar;
import javax.swing.JSpinner;
import javax.swing.JToolBar;
import java.awt.TextArea;
import java.awt.Color;
import javax.swing.JTable;
import java.awt.List;
import javax.swing.JTree;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.JTextField;

public class SimulationFrame {

	private JFrame frame;
	private JTable table;
	private JTable table_1;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					SimulationFrame window = new SimulationFrame();
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public SimulationFrame() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 827, 600);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);
		
		JPanel resPanel = new JPanel();
		resPanel.setBounds(10, 11, 791, 540);
		frame.getContentPane().add(resPanel);
		resPanel.setLayout(null);
		
		JLabel label = new JLabel("Simulation Results:");
		label.setFont(new Font("OCR A Extended", Font.BOLD | Font.ITALIC, 16));
		label.setBounds(10, 11, 267, 59);
		resPanel.add(label);
		
		TextArea resultPanel = new TextArea();
		resultPanel.setBackground(Color.WHITE);
		resultPanel.setForeground(Color.BLUE);
		resultPanel.setEditable(false);
		resultPanel.setBounds(321, 202, 460, 328);
		resPanel.add(resultPanel);
		
		JLabel lblFinalDisplays = new JLabel("Final displays:");
		lblFinalDisplays.setBounds(321, 179, 152, 14);
		resPanel.add(lblFinalDisplays);
		
		JLabel executionTime = new JLabel("Execution time: ");
		executionTime.setBounds(20, 85, 215, 14);
		resPanel.add(executionTime);
		
		JLabel cpi = new JLabel("Cycles per instruction: ");
		cpi.setBounds(20, 120, 200, 14);
		resPanel.add(cpi);
		
		JLabel ipc = new JLabel("Instructions per cycle: ");
		ipc.setBounds(20, 155, 200, 14);
		resPanel.add(ipc);
		
		JLabel cl1 = new JLabel(" Cache level 1:");
		cl1.setBounds(246, 85, 88, 14);
		resPanel.add(cl1);
		
		JLabel cl2 = new JLabel("Cache level 2:");
		cl2.setBounds(246, 120, 89, 14);
		resPanel.add(cl2);
		
		TextArea instText = new TextArea();
		instText.setForeground(Color.RED);
		instText.setBackground(Color.WHITE);
		instText.setEditable(false);
		instText.setBounds(24, 202, 253, 220);
		resPanel.add(instText);
		
		JLabel lblCacheLevel = new JLabel("Cache level 3:");
		lblCacheLevel.setBounds(246, 155, 90, 14);
		resPanel.add(lblCacheLevel);
		
		JLabel lblHitRatio = new JLabel("Hit Ratio");
		lblHitRatio.setBounds(360, 56, 46, 14);
		resPanel.add(lblHitRatio);
		
		JLabel lblMissRatio = new JLabel("Miss Ratio");
		lblMissRatio.setBounds(480, 56, 98, 14);
		resPanel.add(lblMissRatio);
		
		JLabel c1H = new JLabel("");
		c1H.setBounds(366, 85, 46, 14);
		resPanel.add(c1H);
		
		JLabel c1M = new JLabel("");
		c1M.setBounds(486, 85, 46, 14);
		resPanel.add(c1M);
		
		JLabel c2H = new JLabel("");
		c2H.setBounds(366, 120, 46, 14);
		resPanel.add(c2H);
		
		JLabel c2M = new JLabel("");
		c2M.setBounds(486, 120, 46, 14);
		resPanel.add(c2M);
		
		JLabel c3H = new JLabel("");
		c3H.setBounds(366, 155, 46, 14);
		resPanel.add(c3H);
		
		JLabel c3M = new JLabel("");
		c3M.setBounds(486, 155, 46, 14);
		resPanel.add(c3M);
		
		JLabel lblAccessTime = new JLabel("Access Time");
		lblAccessTime.setBounds(560, 56, 88, 14);
		resPanel.add(lblAccessTime);
		
		JLabel at1 = new JLabel("");
		at1.setBounds(568, 85, 46, 14);
		resPanel.add(at1);
		
		JLabel at2 = new JLabel("");
		at2.setBounds(568, 120, 46, 14);
		resPanel.add(at2);
		
		JLabel at3 = new JLabel("");
		at3.setBounds(568, 155, 46, 14);
		resPanel.add(at3);
		
						
	}
}
